package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 地图图层表
 * @TableName map_layer
 */
@TableName(value ="map_layer")
@Data
public class MapLayer implements Serializable {
    /**
     * 图层ID
     */
    @TableId(type = IdType.AUTO)
    private Long layerId;

    /**
     * 图层名称
     */
    private String layerName;

    /**
     * 图层类型
     */
    private String layerType;

    /**
     * 图层地址
     */
    private String layerUrl;

    /**
     * 图层数据
     */
    private String layerData;

    /**
     * 显示顺序
     */
    private Integer displayOrder;

    /**
     * 是否可见：0-否，1-是
     */
    private Integer visible;

    /**
     * 状态：1-启用，2-禁用
     */
    private Integer status;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MapLayer other = (MapLayer) that;
        return (this.getLayerId() == null ? other.getLayerId() == null : this.getLayerId().equals(other.getLayerId()))
            && (this.getLayerName() == null ? other.getLayerName() == null : this.getLayerName().equals(other.getLayerName()))
            && (this.getLayerType() == null ? other.getLayerType() == null : this.getLayerType().equals(other.getLayerType()))
            && (this.getLayerUrl() == null ? other.getLayerUrl() == null : this.getLayerUrl().equals(other.getLayerUrl()))
            && (this.getLayerData() == null ? other.getLayerData() == null : this.getLayerData().equals(other.getLayerData()))
            && (this.getDisplayOrder() == null ? other.getDisplayOrder() == null : this.getDisplayOrder().equals(other.getDisplayOrder()))
            && (this.getVisible() == null ? other.getVisible() == null : this.getVisible().equals(other.getVisible()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getLayerId() == null) ? 0 : getLayerId().hashCode());
        result = prime * result + ((getLayerName() == null) ? 0 : getLayerName().hashCode());
        result = prime * result + ((getLayerType() == null) ? 0 : getLayerType().hashCode());
        result = prime * result + ((getLayerUrl() == null) ? 0 : getLayerUrl().hashCode());
        result = prime * result + ((getLayerData() == null) ? 0 : getLayerData().hashCode());
        result = prime * result + ((getDisplayOrder() == null) ? 0 : getDisplayOrder().hashCode());
        result = prime * result + ((getVisible() == null) ? 0 : getVisible().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", layerId=").append(layerId);
        sb.append(", layerName=").append(layerName);
        sb.append(", layerType=").append(layerType);
        sb.append(", layerUrl=").append(layerUrl);
        sb.append(", layerData=").append(layerData);
        sb.append(", displayOrder=").append(displayOrder);
        sb.append(", visible=").append(visible);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}